package win.bigwhale.sudoku.view;

import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import win.bigwhale.sudoku.SudokuUtil;
import win.bigwhale.sudoku.controller.GameControlInterface;
import win.bigwhale.sudoku.controller.GameController;
import win.bigwhale.sudoku.game.Sudoku;

public class LevelPane extends VBox implements GameControlInterface {
	private static LevelPane levelPane = new LevelPane();
	private String level = null;
	private Label levelLabel = new Label("");
	
	private LevelPane() {
		GameController.getGameController().addPane(this);
		setPrefSize(130.0, 50.0);
		setLayoutX(10.0);
		setLayoutY(70.0);
		setBackground(SudokuUtil.PANE_BACKGROUND);
		getChildren().add(levelLabel);
		setAlignment(Pos.CENTER);

		levelLabel.setLayoutX(10.0);
		levelLabel.setLayoutY(10.0);
	}

	public static LevelPane getLevelPane() {
		return levelPane;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
		levelLabel.setText(level);
	}

	@Override
	public void startGame(Sudoku sudoku) {
		setLevel(sudoku.getLevel());
	}

	@Override
	public void pauseGame() {}

	@Override
	public void resumeGame() {}

	@Override
	public void restartGame() {}

	@Override
	public void endGame() {}

	@Override
	public void completeGame() {}

}
